package com.jimmy.medical.repository;

import com.jimmy.medical.entity.MemberTypeServiceItem;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MemberTypeServiceItemRepository extends JpaSpecificationExecutor<MemberTypeServiceItem>, PagingAndSortingRepository<MemberTypeServiceItem, Long> {

    @Query("select o from MemberTypeServiceItem o  where o.memberType.id=?1 and o.item.serviceFlow in(1,2,3,4,5,6) and o.money>0")
    List<MemberTypeServiceItem> findByMemberType(Long serviceTypeId);
}
